<?php
class IndexAction extends CommonAction {
    public function _initialize() {
        $this->assign ( 'nav', 1 );
        parent::_initialize ();
    }
    
    public function index() {
        $QueueModel = D ( 'Queue' );
        $map = array ();
        $map ['status'] = array ('neq', 100 );
        $allCount = M ( 'Task' )->where ( $map )->count ();
        $map ['status'] = 1;
        $waitCount = M ( 'Task' )->where ( $map )->count ();
        $runCount = $QueueModel->getStatusCount ( 3 );
        $returnCount = $QueueModel->getStatusCount ( 4 );
        $auditReturnCount = $QueueModel->getStatusCount ( 7 );
        
        $this->assign ( 'allCount', $allCount );
        $this->assign ( 'waitCount', $waitCount );
        $this->assign ( 'runCount', $runCount );
        $this->assign ( 'returnCount', $returnCount );
        $this->assign ( 'auditReturnCount', $auditReturnCount );
        
        $this->assign ( 'waitW', $waitCount / $allCount * 100 );
        $this->assign ( 'runW', $runCount / $allCount * 100 );
        $this->assign ( 'returnW', $returnCount / $allCount * 100 );
        $this->assign ( 'auditReturnW', $auditReturnCount / $allCount * 100 );
        $this->display ();
    }
}
?>